package Day09方法重载_参数传递;

public class ChongZai01 {
    public static void main(String[] args) {

        System.out.println(compare(5,6));
        System.out.println(compare((byte)5,(byte)5));
        System.out.println(compare(300L,500L));
        System.out.println(compare(3.0,3.0));
        System.out.println(compare(3.0,3));
    }

    //比较两个数是否相同
    public static boolean compare(byte b1,byte b2){
        //if(b1 == b2){
        //    return true;
        //} else{
        //    return false;
        //}
        System.out.println("byte比较");
        return b1 == b2;
    }

    public static boolean compare(short s1,short s2){
        System.out.println("short比较");
        return s1 == s2;
    }

    public static boolean compare(int i1,int i2){
        System.out.println("int比较");
        return i1 == i2;
    }

    public static boolean compare(long l1,long l2){
        System.out.println("long比较");
        return l1 == l2;
    }

    public static boolean compare(double d1,double d2){
        System.out.println("double比较");
        return d1 == d2;
    }

    public static boolean compare(double d,int i){
        System.out.println("double int比较");
        return d == i;
    }
}
